<template>
  <div class="activityBox">
    <el-row class="headFixed">
      <el-col :span="3" :offset="21">
        <el-button type="primary" @click="submitSave">保存</el-button>
        <el-button>取消</el-button>
      </el-col>
    </el-row>
    <!-- 基本信息 -->
    <basic ref="superiorForm"/>
    <!-- 活动商品明细 -->
    <detail/>
    <!-- 活动图片 -->
    <pictures/>
    <!-- 活动描述 -->
    <div class="describeBox">活动描述</div>
    <div style="margin-bottom:20px;">
      <tinymce :toolbar="toolbar" :height="250" :show="true"/>
    </div>
  </div>
</template>
<script>
import Basic from './components/editActivity/basicInfo'
import Detail from './components/editActivity/activityDetail'
import Pictures from './components/editActivity/activityPicture'
// 富文本编辑器
import Tinymce from '@/components/Tinymce'
import toolbar from '@/components/Tinymce/toolbar.js'

export default {
  components: {
    Basic,
    Detail,
    Pictures,
    Tinymce
  },
  data() {
    return {
      toolbar
    }
  },
  methods: {
    submitSave() {
      this.$refs.superiorForm.$refs.basicForm.validate((valid) => {
        if (valid) {
          alert('submit!')
        } else {
          console.log('error submit!!')
          return false
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>
.activityBox {
  padding: 0 20px;
  .headFixed {
    margin-top: 10px;
    width: 100%;
    height: 60px;
    line-height: 60px;
    background-color: #e6e9ed;
  }
}
.describeBox {
  color: rgb(52, 172, 228);
  padding: 10px 30px;
  background: #ebfcf9;
  margin: 20px 0;
  overflow: hidden;
}
</style>

